package com.ccys.cms.controller.masterData;

import com.ccys.cms.service.masterData.MedicationReactionService;
import com.ccys.common.constants.TouristApi;
import com.ccys.common.vo.ResponseResult;
import com.ccys.db.dto.masterData.MedicationReactionDelDto;
import com.ccys.db.dto.masterData.MedicationReactionPageQueryDto;
import com.ccys.db.dto.masterData.MedicationReactionSaveDto;
import com.ccys.db.vo.masterData.MedicationReactionPageQueryVo;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @program: WhiteCoat
 * @description: 药物反应接口
 * @author: ZhangJingCan
 * @create: 2023-12-12 13:23
 **/

@RestController
@RequestMapping("masterData")
@Api(tags = "masterData-药物反应接口")
public class MedicationReactionController {

    @Autowired
    private MedicationReactionService medicationReactionService;


    
    @PostMapping("medicationReaction")
    @ApiOperation("保存药物反应")
    public ResponseResult save(MedicationReactionSaveDto dto) {
        return medicationReactionService.save(dto);
    }

    @PutMapping("medicationReaction")
    @ApiOperation("修改药物反应")
    public ResponseResult edit(MedicationReactionSaveDto dto) {
        return medicationReactionService.save(dto);
    }

    
    @DeleteMapping("medicationReaction")
    @ApiOperation("根据ID删除药物反应")
    public ResponseResult delete(MedicationReactionDelDto dto) {
        return medicationReactionService.delete(dto);
    }

    
    @GetMapping("medicationReaction")
    @ApiOperation("分页查询药物反应")
    public ResponseResult<PageInfo<MedicationReactionPageQueryVo>, Object> findPage(MedicationReactionPageQueryDto dto) {
        return medicationReactionService.findPage(dto);
    }

}
